package 程序.构造方法;

import java.util.Objects;

public class PetAdoption {
    public static void main(String[] args) {
        Cat c1=new Cat("小白","北京");
        Cat c2=new Cat("小黑","上海");
        User u1=new User("tom","北京");
        if (Objects.equals(u1.region, c1.region)){
            System.out.println(c1.name);
            System.out.println("领养成功");

        }else {
            System.out.println(c1.name);
            System.out.println("非同城不能领养");
        }
        if (Objects.equals(u1.region, c2.region)){
            System.out.println(c2.name);
            System.out.println("领养成功");
        }else {
            System.out.println(c2.name);
            System.out.println("非同城不能领养");
        }
    }
}
